package kr.hkit.powerjava.chapter22.collection;

import java.util.HashMap;
import java.util.Map;

public class WordFreq {

	public static void main(String[] args) {
		Map<String, Integer>m = new HashMap<String, Integer>();
		
		String[] sample = {"to", "be", "or", "not", "to", "be", "is", "a", "problem"};
		
		for(String a : sample){
			Integer freq = m.get(a);
			m.put(a, (freq == null)? 1: freq+1);
		}
		
		
	}
}
